package com.mou.controller.user;


import com.mou.result.Result;
import com.mou.service.CategoryService;
import com.mou.vo.ProductCategoryVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userCategoryController")
@RequestMapping("/user/category")
@Slf4j
public class CategoryController {
    @Autowired
    private CategoryService categoryService;


    @GetMapping("/list")
    public Result<List<ProductCategoryVO>> list() {
        log.info("获取用户界面所有产品分类");
        List<ProductCategoryVO> productCategoryVO = categoryService.getList();
        return Result.success(productCategoryVO);
    }
}
